﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="废料招标单价.aspx.cs" Inherits="syc.Store.废料招标单价" %>

<html>
<head>
<title></title>
</head>
<body>
<script type="text/javascript" language="javascript" src="/common.js"></script>

<form id="form1" runat="server">
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
SelectCommand="select * from 废料季度招标单价 "
DeleteCommand="delete from 废料季度招标单价 where 年度=@年度 and 季度=@季度 and 废料ID=@废料ID"
UpdateCommand="update 废料季度招标单价 set 计划单价=@计划单价,实际单价=@实际单价 where 年度=@年度 and 季度=@季度 and 废料ID=@废料ID;exec [dbo].[更新废料到发记录单价] @年度,@季度,@废料ID,@实际单价 "
InsertCommand="insert into 废料季度招标单价 values(@年度,@季度,@废料ID,@计划单价,@实际单价)"
onselected="SqlDataSource1_Selected" >
<InsertParameters>
<asp:Parameter Name="年度" DbType="Int32" Size="4" />
<asp:Parameter Name="季度" DbType="Int32" Size="4" />
<asp:Parameter Name="废料ID" DbType="Int32" Size="4" />
<asp:Parameter Name="计划单价" DbType="Decimal" Size="18"/>
<asp:Parameter Name="实际单价" DbType="Decimal" Size="8"/>
</InsertParameters>

<UpdateParameters>
<asp:Parameter Name="年度" DbType="Int32" Size="4" />
<asp:Parameter Name="季度" DbType="Int32" Size="4" />
<asp:Parameter Name="废料ID" DbType="Int32" Size="4" />
</UpdateParameters>

<SelectParameters>
<asp:Parameter Name="ID" DbType="Int32" Size="4" DefaultValue="0" />
</SelectParameters>


</asp:SqlDataSource>
    
<asp:SqlDataSource ID="SqlDataSource2" runat="server" 
    ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
    SelectCommand="SELECT [ID], [废料名称]  FROM [废料]"></asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource3" runat="server" 
    ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
    SelectCommand="select 0 as ID,'全部' as 废料名称 union SELECT [ID], [废料名称]  FROM [废料]"></asp:SqlDataSource>    
<div id="wintop" class="wintop" style="display:none">废料招标价</div>

<asp:Panel ID="Panel1" runat="server" CssClass="panel">
<asp:Button ID="Add" runat="server" Text="添 加" CssClass="button" 
        onclick="Add_Click"/>
<input type="button" value="关 闭" class="button" onclick="parent.swin2_close();" />
</asp:Panel>
<asp:Panel ID="Panel2" runat="server" CssClass="panel" GroupingText="季度单价" Visible="false">
<div style="font-size:4px;line-height:4px;height:4px;"></div>
<span style="display:inline-block;width:160px;text-align:right;">
            
                年 度：<asp:DropDownList ID="NianDu" runat="server" Width="80px" AutoPostBack="true">                   
                    <asp:ListItem>2010</asp:ListItem>
                    <asp:ListItem>2011</asp:ListItem>
                    <asp:ListItem>2012</asp:ListItem>
                    <asp:ListItem>2013</asp:ListItem>
                    <asp:ListItem>2014</asp:ListItem>
                    <asp:ListItem>2015</asp:ListItem>
                    <asp:ListItem>2016</asp:ListItem>
                    <asp:ListItem>2017</asp:ListItem>
                </asp:DropDownList>
            </span> 
            <span style="margin-left:80px;"></span>
            <asp:Label ID="JiDu0" runat="server">季 度：</asp:Label>        
             <asp:DropDownList ID="JiDu" runat="server" Width="80px" AutoPostBack="true" >                    
                    <asp:ListItem Value="1">一季度</asp:ListItem>
                    <asp:ListItem Value="2">二季度</asp:ListItem>
                    <asp:ListItem Value="3">三季度</asp:ListItem>
                    <asp:ListItem Value="4">四季度</asp:ListItem>          
             </asp:DropDownList> 
   <span style="margin-left:50px;"></span>
   废料：<asp:DropDownList ID="FeiLiao" runat="server" Width="70px" 
        DataSourceID="SqlDataSource2" DataTextField="废料名称" DataValueField="ID">
</asp:DropDownList>
    <br>

<span style="margin-left:10px;"></span>
计划单价：<asp:TextBox runat="server" ID="JiHuaDanJia" CssClass="textbox" width="70">
    </asp:TextBox>元
<span style="margin-left:60px;"></span>
实际单价：<asp:TextBox runat="server" ID="ShiJiDanJia" CssClass="textbox" width="70">
    </asp:TextBox>元&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID="Button_Add" runat="server" Text="增 加" 
    CssClass="mbutton" UseSubmitBehavior="false" onclick="Button_Add_Click" />
&nbsp;<asp:Button ID="Button_Cancle" runat="server" Text="取 消" 
    CssClass="mbutton" UseSubmitBehavior="false" onclick="Button_Cancle_Click" />
</asp:Panel>
<asp:Panel ID="Panel3" runat="server" CssClass="panel" GroupingText="查询季度单价">

<div style="font-size:4px;line-height:4px;height:4px;"></div>
<span style="display:inline-block;width:161px; text-align:right;">
            
                年 度：<asp:DropDownList ID="Year" runat="server" Width="80px" AutoPostBack="true">                   
                    <asp:ListItem>全部</asp:ListItem>
                    <asp:ListItem>2010</asp:ListItem>
                    <asp:ListItem>2011</asp:ListItem>
                    <asp:ListItem>2012</asp:ListItem>
                    <asp:ListItem>2013</asp:ListItem>
                    <asp:ListItem>2014</asp:ListItem>
                    <asp:ListItem>2015</asp:ListItem>
                    <asp:ListItem>2016</asp:ListItem>
                    <asp:ListItem>2017</asp:ListItem>
                </asp:DropDownList>
            </span> 
            <span style="margin-left:20px;"></span>
            <asp:Label ID="Label1" runat="server">季 度：</asp:Label>        
             <asp:DropDownList ID="Quarter" runat="server" Width="80px" AutoPostBack="true" > 
                    <asp:ListItem Value="0">全 部</asp:ListItem>                   
                    <asp:ListItem Value="1">一季度</asp:ListItem>
                    <asp:ListItem Value="2">二季度</asp:ListItem>
                    <asp:ListItem Value="3">三季度</asp:ListItem>
                    <asp:ListItem Value="4">四季度</asp:ListItem>          
             </asp:DropDownList> 
   <span style="margin-left:20px;"></span>
   废料：<asp:DropDownList ID="FeiLiao0" runat="server" Width="70px" 
        DataSourceID="SqlDataSource3" DataTextField="废料名称" DataValueField="ID">
</asp:DropDownList>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:Button ID="Button_Query" runat="server" CssClass="mbutton" Text="查 询" onclick="Button_Query_Click"
        UseSubmitBehavior="false" />
</asp:Panel>
<asp:Panel ID="Panel4" runat="server" CssClass="panel2"  Visible="true">
        <asp:Label ID="Message" runat="server" Text="·准备就绪" CssClass="prompt"></asp:Label>
    </asp:Panel>
<style>
tr.tr.grid-row-normal{cursor:default;}
</style>
<div class="gridframe" style="padding:5px;">
    <div class="gridview">
    
        <table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#e5cfab">
            <tr>
	            <td class="grid-title">废料单价</td>
	        </tr>
	        <tr>
	            <td class="grid-back">
                    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                        AutoGenerateColumns="False" CssClass="grid" DataKeyNames="年度,季度,废料ID" 
                        DataSourceID="SqlDataSource1" 
                        GridLines="None" ondatabound="GridView1_DataBound" 
                        onpageindexchanged="GridView1_PageIndexChanged" AllowSorting="True" 
                        UseAccessibleHeader="False" >
                        <PagerSettings Visible="False" />
                        <RowStyle CssClass="grid-row-normal" />
                        <Columns>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <img src="/Icons/online.gif" style="margin-top:2px;" alt="" />
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="20px" />
                            </asp:TemplateField>                            
                          
                             <asp:TemplateField HeaderText="年度">
                                <ItemTemplate>
                                    <asp:Label ID="Label_nd" runat="server" Text='<%# Eval("年度") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                            </asp:TemplateField>
                            
                             <asp:TemplateField HeaderText="季度">
                                <ItemTemplate>
                                    <asp:Label ID="Label_jd" runat="server" Text='<%# Eval("季度") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                            </asp:TemplateField>
                            
                            <asp:TemplateField HeaderText="废料名称">
                                <ItemTemplate>
                                    <asp:Label ID="Label_pm" runat="server" Text='<%# Eval("废料名称") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                            </asp:TemplateField>
                           

                              <asp:TemplateField HeaderText="计划单价(元)">
                                <ItemTemplate>
                                    <asp:Label ID="Label_jhdj" runat="server" Text='<%# Eval("计划单价") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox runat="server" ID="Edit_JiHuaDanJia" Text='<%# Bind("计划单价") %>' CssClass="textbox" width="100%"></asp:TextBox>
                                </EditItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Right" Width="100px" />
                            </asp:TemplateField>
                            
                            <asp:TemplateField HeaderText="实际单价(元)">
                                <ItemTemplate>
                                    <asp:Label ID="Label_sjdj" runat="server" Text='<%# Eval("实际单价") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox runat="server" ID="Edit_ShiJiDanJia" Text='<%# Bind("实际单价") %>' CssClass="textbox" width="100%"></asp:TextBox>
                                </EditItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Right" Width="100px" />
                            </asp:TemplateField>                           
                            
                          
                                                       
                            <asp:TemplateField HeaderText="操作" >
                                <ItemTemplate>
                                    <asp:Button ID="Button_Edit" runat="server" CommandName='Edit' Text="修 改" CssClass="mbutton" UseSubmitBehavior="false" />
                                    <asp:Button ID="Button_Delete" runat="server" CommandName='Delete' Text="删 除" CssClass="mbutton" UseSubmitBehavior="false" OnClientClick="if(!confirm(msg))return(false);" />
                               </ItemTemplate>
                               <EditItemTemplate>
                                    <asp:Button ID="Button_Update" runat="server" CommandName='Update' Text="更 新" CssClass="mbutton" UseSubmitBehavior="false" />
                                    <asp:Button ID="Button_Cancel" runat="server" CommandName='Cancel' Text="取 消" CssClass="mbutton" UseSubmitBehavior="false" />
                               </EditItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="124px" />
                            </asp:TemplateField>
                            

                        </Columns>
                      </asp:GridView>
	            </td>
            </tr>
            <tr>
	            <td>   
	                <table width="100%">
	                    <tr>
	                        <td class="pagebar">
                                <asp:Button ID="Button_Pager_First" runat="server" Text="" ToolTip="首页" 
                                    CssClass="pageturn-first-b" onclick="Pager_Click" CommandName="--" UseSubmitBehavior="false" />
                                <asp:Button ID="Button_Pager_Prev" runat="server" Text="" ToolTip="上一页" 
                                    CssClass="pageturn-prev-b" onclick="Pager_Click" CommandName="-" UseSubmitBehavior="false" />
                                <input type="button" class="page-split" disabled />第<asp:TextBox ID="TextBox_Pager" runat="server" CssClass="pageturn" AutoPostBack="true"
                                    ontextchanged="Pager_Click"></asp:TextBox>页<input type="button" class="page-split" disabled /><asp:Label ID="Label_Pages" runat="server"></asp:Label><input type="button" class="page-split" disabled />
                                
                                <asp:Button ID="Button_Pager_Next" runat="server" Text="" ToolTip="下一页" 
                                    CssClass="pageturn-next-b" onclick="Pager_Click" CommandName="+"  UseSubmitBehavior="false"/>
                                <asp:Button ID="Button_Pager_Last" runat="server" Text="" ToolTip="末页" 
                                    CssClass="pageturn-last-b" onclick="Pager_Click" CommandName="++" UseSubmitBehavior="false" /><asp:Label ID="Label9" runat="server"></asp:Label><input type="button" class="page-split" disabled />
                            </td>
                            <td class="pagebar" align="right">
                                <asp:Label ID="Label_Total" runat="server"></asp:Label>
                            </td>
                        </tr>
                   </table>

	            </td>
            </tr>
        </table>
        

    </div>
</div>

</form>
<script type="text/javascript">
var msg = '确认要删除该条记录吗？';

document.onkeydown = function(e) {
    if (!e) e = window.event;
    var tag = e.srcElement;
    if (!tag) tag = e.target;
    if (tag.tagName != "INPUT" || tag.className != "textbox") return;
    if (e.keyCode == 13) e.keyCode = 9;
}
var textboxs = document.getElementsByTagName("input");
var i;
for (i = 0; i < textboxs.length; i++) {
    if (textboxs[i].className == "textbox") {
        //textboxs[i].onchange = function(e) { this.className = "textbox-changed"; };
        textboxs[i].onfocus = function(e) { this.select(); };
    }
    else if (textboxs[i].className == "pageturn" || textboxs[i].className == "intxt1" || textboxs[i].className == "intxt2") {
        textboxs[i].onfocus = function(e) { this.select(); };
    }
}
setTimeout("document.getElementById('ShuLiang').focus();", 100);

</script>
</body>
</html>

